Micron Document
Fox's Git Mirrors

Node / RFnexus / code.git / files / simd_sort.hh

Displaying Raw • Download

simd_sort.hh fbbc6555890e66e8a278ab5246edcce4070deb9a (fbbc6555) Text, 495 B

/*
Sorting for SIMD types

Copyright 2024 Ahmet Inan <inan@aicodix.de>
*/

#pragma once

#include "sort.hh"

template <typename TYPE, int WIDTH>
static inline SIMD<typename SIMD<TYPE, WIDTH>::uint_type, WIDTH> vorder(SIMD<TYPE, WIDTH> a)
{
SIMD<typename SIMD<TYPE, WIDTH>::uint_type, WIDTH> p;
CODE::insertion_sort(p.v, a.v, WIDTH);
return p;
}

template <typename TYPE, int WIDTH>
static inline SIMD<TYPE, WIDTH> vsort(SIMD<TYPE, WIDTH> a)
{
CODE::insertion_sort(a.v, WIDTH);
return a;
}


Served by rngit 1.5.0 - Generated in 0.03s